package com.veromca.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Controller
@RequestMapping("/api/test")
public class TestController {

	// 这里指定RequestMethod，如果不指定Swagger会把所有RequestMethod都输出，在实际应用中，具体指定请求类型也使接口更为严谨。
	@ResponseBody
	@RequestMapping(value = "/show", method = RequestMethod.GET)
	@ApiOperation(value = "测试接口", notes = "测试接口详细描述")
	public String show(@ApiParam(required = true, name = "name", value = "姓名") @RequestParam("name") String stuName) {
		System.out.println(stuName);
		return stuName;
	}
}
